<template>
    <view class="uc-wrap uc-dynamics-dynamics">
        <ucHead></ucHead>
        <view class="filter">
            <view :class="current==1?'item on':'item'" @click="current=1">最新</view>
            <!-- <view :class="current==2?'item on':'item'" @click="current=2">酒店案例</view> -->
        </view>
        <view class="g-hotelItem" v-for="(item,index) in feedObjList" :key="index">
            <view class="shop">
                <view class="face">
                    <image src="https://my.bziyun.com/20250619/face_1750325367141.png" mode="aspectFill"></image>
                </view>
                <view class="con">
                   <view class="name">{{userObj.companyName}}</view>
                   <view class="time">{{item.createTime}}</view>
                </view>
            </view>
            <view class="tags">
                <text class="tag">#{{item.feedTypeName}}</text>
            </view>
            <view class="desc">{{item.feedName}}</view>
            <view class="imgs-box">
                <view class="img" v-for="(itemImg,indexImg) in item.feedPicList" :key="indexImg" @click="btnShowHotelItemImgs(item.feedPicList,indexImg)">
                    <image :src="itemImg" mode="aspectFill"></image>
                </view>
            </view>
            <view class="btm">
                <view class="btn" @click="isFinger = !isFinger">
                    <image src="@/static/images/hotelItem-icon-2-on.png" mode="widthFix" class="uc-icon36" v-if="isFinger"></image>
                    <image src="@/static/images/hotelItem-icon-2.png" mode="widthFix" class="uc-icon36" v-else></image>
                    1
                </view>
            </view>
           <!-- <view class="reply">
                <view class="reply-item"><text class="uc-b">微信用户4469：</text>佳佳佳佳</view>
                <view class="more">查看1条评论</view>
            </view>
            <view class="input-box">
                <view class="face">
                    <image src="https://my.bziyun.com/20250619/face-default_1750324928973.png" mode="aspectFill"></image>
                </view>
                <input type="text" class="uc-input" placeholder="简单说说..." value="" placeholder-class="uc-phColor" />
            </view> -->
        </view>
        <!-- <navigator class="g-fixedService" url="" hover-class="none">
            <view class="face">
                <image src="https://my.bziyun.com/20250619/face_1750325367141.png" mode="aspectFill"></image>
            </view>
            <view class="txt">咨询</view>
        </navigator> -->
    </view>
    <ucFoot :selectIndex="2"></ucFoot>
    <view class="uc-alert uc-alert-Share" v-if="showShare" @touchmove.stop.prevent="doNothing">
        <view class="over-close" @click="showShare=false"></view>
        <view class="box-bottom">
            <view class="part">
                <view class="btn" @click="openShare">
                    <image src="https://my.bziyun.com/20250619/alert-Share-icon-1_1750323144123.png" mode="widthFix" class="uc-icon120"></image>微信好友
                </view>
                <view class="btn">
                    <image src="https://my.bziyun.com/20250619/alert-Share-icon-2_1750323223360.png" mode="widthFix" class="uc-icon120"></image>保存海报
                </view>
            </view>
            <view class="operate">
                <button class="uc-btn" hover-class="none" @click="showShare=false">取消</button>
            </view>
        </view>
    </view>
</template>
<script setup>
    import { ref } from 'vue'
	import { useMainStore } from '@/store/index.js'
	const mainStore= useMainStore();
	
    const current = ref(1)
    const showShare = ref(false)
    const doNothing = () => {}
	//获取当前登录信息
	const userObj = ref({})
	userObj.value = mainStore.userInfoObj
	
	//获取动态信息
	const feedObjList = ref(null)
	const getfeedInfo = ()=>{
		uni.request({
			url: `https://muyin-pc.51wephone.cn/app-api/feed/queryList`, // 接口地址
			method: 'POST', // 请求方式
			data: { // GET 请求时，通常在 url 中拼接参数，POST 请求时放在这里
				pageNum:1,
				pageSize:10,
			},
			header:{
				"TOKEN":mainStore.userInfo.token,
			},
			success: (res) => {
				console.log('请求成功:', res.data);
				feedObjList.value = res.data.data
			},
			fail: (err) => {
				console.error('请求失败:', err);
			}
		});
	}
	getfeedInfo()
	
	
	// 分享
	const openShare = ()=>{
		
	}
    const isFinger = ref(false)
    const btnShowHotelItemImgs = (urls, index) => {
        uni.previewImage({
            current: index,
            urls: urls,
            longPressActions: {
                itemList: ['发送给朋友', '保存图片', '收藏'],
                success: function(data) {
                    console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
                },
                fail: function(err) {
                    console.log(err.errMsg);
                }
            }
        });
    }
</script>